package com.wuseguang.springcloud.thread;

import com.wuseguang.springcloud.JdbcTemplate.HaiweidaCooperativeSchoolJdbc;
import com.wuseguang.springcloud.util.SpringBeanUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;
@Component
public class HaiweidaDepartment implements Runnable {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    private HaiweidaCooperativeSchoolJdbc haiweidaCooperativeSchoolJdbc;

    //学校id
    private String schoolId;

    @Override
    public void run() {
        try {
            haiweidaCooperativeSchoolJdbc = SpringBeanUtil.getBean(HaiweidaCooperativeSchoolJdbc.class);
            haiweidaCooperativeSchoolJdbc.haiweidaDepartment(schoolId);
        }catch (Exception e){
            logger.info("海威达部门同步失败");
        }
    }

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId;
    }
}
